-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pool Overview redesign #2435
base: main
Are you sure you want to change the base?
Pool Overview redesign #2435
Conversation
PR deployed in Google Cloud |
PR deployed in Google Cloud |
1013fe1
to
a392405
Compare
66fc7a5
to
1181892
Compare
909545e
to
35bc8e6
Compare
c29f491
to
dbe5c48
Compare
dbe5c48
to
58bf009
Compare
90bc09f
to
4afb124
Compare
const data: ChartData[] = React.useMemo( | ||
() => | ||
truncatedPoolStates?.map((day) => { | ||
truncatedPoolStates?.map((day: any) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
truncatedPoolStates?.map((day: any) => { | |
truncatedPoolStates?.map((day) => { |
better to make sure truncatedPoolStates
is typed rather than casting day as any
<Box width="8px" height="8px" borderRadius="50%" backgroundColor={color} marginRight="4px" /> | ||
) | ||
|
||
const navObj = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const navObj = { | |
const navData = { |
for consistency though out
|
||
const graphData = selectedTabIndex === 0 ? tokenData : apyData | ||
|
||
const toggleRange = (e: any) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's try and avoid anys please!
</Shelf> | ||
<Box display="flex" justifyContent="space-between" alignItems="center"> | ||
<Box display="flex" justifyContent="space-evenly"> | ||
{graphData.map((item: any, index: any) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here too!
type DailyPoolStateProps = { | ||
timestamp: string | ||
tranches: { [trancheId: string]: TrancheState } | ||
apy?: Perquintill | undefined | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rather build the type from the existing dailyPoolState using Pick
or Omit
so that we can more easily catch changes if they were to happen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for TrancheState as well
const data = React.useMemo(() => { | ||
const tokenData = | ||
dailyPoolStates?.map((state) => { | ||
return { price: state.tranches[trancheId].price?.toFloat() || 0, day: new Date(state.timestamp) } | ||
dailyPoolStates?.map((state: DailyPoolStateProps) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dailyPoolStates?.map((state: DailyPoolStateProps) => { | |
dailyPoolStates?.map((state) => { |
again this type should be interfered if dailyPoolStates
is type properly
import { Spinner } from '../Spinner' | ||
import { Tooltips } from '../Tooltips' | ||
|
||
const StyledPillButton = styled(PillButton)` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems this can be removed?
interface DailyTrancheState { | ||
yield30DaysAnnualized: Perquintill | ||
timestamp: string | ||
} | ||
|
||
function hasValuationMethod(pricing: any): pricing is { valuationMethod: string } { | ||
return pricing && typeof pricing.valuationMethod === 'string' | ||
type DailyTrancheStateArr = Record<string, DailyTrancheState[]> | ||
|
||
type Tranche = { | ||
currency: { | ||
name: string | ||
} | ||
id: string | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also here best to build the types from existing ones rather than redeclaring, recommend using Pick
or Omit
const fmk = useFormikContext<PoolMetadataInput>() | ||
const { values } = fmk | ||
|
||
console.log('FORM', values) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops
https://www.figma.com/design/ng7qdNcSCXSDA6ZUdWIs6u/Pool-Overview%2F-Pool-Detail?node-id=2802-6256&node-type=frame&t=HdoH2YlSaWxLKG0U-0
#2427